<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="author" content="lushu">
		<title>坏帐报表</title>
		<script type="text/javascript" language="javascript" src="../script/common.js"></script>
		<script type="text/javascript" language="javascript" src="../script/common_stat.js"></script>
		<script type="text/javascript" language="javascript">
			var Page;
			function initPageElements(){
				Page.statSets = [StatClass.Org];
				//Page.sql = 'ppstrade_station';
				Page.useOrg = true;
				Page.tradeTypeSpec = function(temp,orgLevel){
					switch(orgLevel){
						case Constants.ORG_LEVEL_HQ:
							temp.defaultHorizon.org = {p200:true};
							break;
						case Constants.ORG_LEVEL_PROVINCE:
							temp.defaultHorizon.org = {p500:true};
							break;
						case Constants.ORG_LEVEL_CITY:
							temp.defaultHorizon.org = {p700:true};
							break;
					}
				}
				
				Page.initPivot = function(){
					Page.ppsTrade = new Pivot("ppsTrade",'ppstrade_station');
					Page.ppsTrade.setPivotHead('pivotTitle','坏帐报表 - 未处理异常交易');
					Page.ppsTrade.setPivotHead('statClass','未处理异常交易');
					_initPivot(Page.ppsTrade,PivotPage.CrosstabConf.getPpsTradeConf());
					
					Page.dealedTrade = new Pivot("dealedTrade",'dealed_error_trade');
					Page.dealedTrade.setPivotHead('pivotTitle','坏帐报表 - 已处理异常交易');
					Page.dealedTrade.setPivotHead('statClass','已处理异常交易');
					_initPivot(Page.dealedTrade,PivotPage.CrosstabConf.getDealedTradeConf());
				}
				
				Page.showPiovt = function(){
					var now = Format.today(true);
					_showPivot(Page.ppsTrade,now);
					_showPivot(Page.dealedTrade,now);
				}
			}
			
			function _initPivot(pivot,conf){
				Page.tradeTypeSpec(conf,Page.orgSpec.LEVEL);
				pivot.initConf(conf);
			}
			
			function _showPivot(pivot,now){
				pivot.param = PivotPage._getParam();
				PivotPage.setOrg(pivot.param,'org');
				pivot.setPivotHead('statTime',now);
				pivot.setPivotHead('beginTime',pivot.param.beginDate);
				pivot.setPivotHead('endTime',pivot.param.endDate);
				pivot.refresh();
			}
			

		</script>
	</head>
	<body onload="PivotPage.init();" >
		<div class="nav"><div id="nav">&nbsp;</div></div>
		<div id="queryView" class="form">
			<div class="formTitle">坏帐报表：查询条件</div>
			<form id="statForm" name="statForm">
				<table width="100%" cellspacing="0" cellpadding="4">
					<tr>
						<td colspan="2">
							<label>报表类型</label> 
							<span id="statClass"></span>
						</td>
					</tr>
				</table>
				<div id="stat_btn"></div>
			</form>
		</div>
		<!--统计结果显示部分-->
		<div id="pivotView" style="display:none;">
			<div id="dealedTrade"></div>
			<div id="ppsTrade"></div>
		</div>
	</body>
</html>
